// AWTApplet.h: interface for the AWTApplet class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_AWTAPPLET_H__CE76083F_3E56_11D2_A3F0_006097A44215__INCLUDED_)
#define AFX_AWTAPPLET_H__CE76083F_3E56_11D2_A3F0_006097A44215__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#include "AWTPanel.h"
#include "AWTFocusManager.h"

#ifdef _UNDER_CE

class AFX_EXT_CLASS AWTApplet : public AWTPanel
{
DECLARE_DYNAMIC(AWTApplet)
public:
	AWTApplet(CWnd* parent);
	AWTApplet();  //jd 09/05/00
	~AWTApplet();
	CWnd* createComponent()
	{
		CRect rc;
		CWnd* parent = getParent()->getPeer();
		parent->GetClientRect(&rc);
		setBounds(rc);
		return AWTPanel::createComponent();
	}
/*
	void init() = 0;
	virtual void start() = 0;
	virtual void stop() = 0;
	virtual void destroy() = 0;
*/
	void transferFocus(AWTComponent* base) 
		{nextFocus(base);}
	void nextFocus(AWTComponent* base)
		{m_focusManager->focusNext(base);}
	AWTFocusManager* getFocusManager()
		{return m_focusManager;}
protected:
	AWTFocusManager* m_focusManager;
};

#else

class AFX_EXT_CLASS AWTApplet : public AWTPanel
{
DECLARE_DYNAMIC(AWTApplet)
public:
	AWTApplet(CWnd* parent);
	AWTApplet();  //jd 09/05/00
	virtual ~AWTApplet();
	virtual CWnd* createComponent()
	{
		CRect rc;
		CWnd* parent = getParent()->getPeer();
		parent->GetClientRect(&rc);
		setBounds(rc);
		return AWTPanel::createComponent();
	}
	virtual void init() = 0;
	virtual void start() = 0;
	virtual void stop() = 0;
	virtual void destroy() = 0;
	virtual void transferFocus(AWTComponent* base) 
		{nextFocus(base);}
	virtual void nextFocus(AWTComponent* base)
		{m_focusManager->focusNext(base);}
	AWTFocusManager* getFocusManager()
		{return m_focusManager;}
	AWTFrame* getFrame()
		{return &m_frame;}
protected:
	AWTFocusManager* m_focusManager;
	AWTFrame m_frame;
};

#endif //UNDER_CE

#endif // !defined(AFX_AWTAPPLET_H__CE76083F_3E56_11D2_A3F0_006097A44215__INCLUDED_)
